<template>
  <view style="height: 100vh; position: relative">
    <view :style="{height: height + 'px'}"></view>
    <!-- 顶部自定义导航 -->
    <TnNavbar fixed alpha customBack :placeholder="false" bg-color="transparent" :bottom-shadow="false">
      <view slot="back" class='tn-custom-nav-bar__back'>
        <text class='icon tn-icon-left'></text>
        <text class='icon tn-icon-home-capsule-fill'></text>
      </view>
      <view>{{ title }}</view>
    </TnNavbar>
    <scroll-view
        scroll-y
        :style="{height: `calc(100vh - ${height}px)`}"
        style="padding: 0 10px 10px"
        scroll-with-animationx
    >
<!--      <image-->
<!--          style="width: 100%"-->
<!--          mode="widthFix"-->
<!--          :src="imageUrl"-->
<!--      ></image>-->
      <view v-html="content"></view>
    </scroll-view>
    <loading-page :show="loading" />
  </view>
</template>

<script setup>
  import {getCurrentInstance, onMounted, ref} from 'vue'
  import TnNavbar from "../../uni_modules/tuniaoui-vue3/components/navbar/src/navbar.vue";
  import {useUniAppSystemRectInfo} from "../../uni_modules/tuniaoui-vue3/hooks/use-uniapp-system-rect-info";
  import LoadingPage from "../../components/loadingPage.vue";

  const {proxy} = getCurrentInstance()

  const {height} = useUniAppSystemRectInfo().navBarInfo

  const content = ref('')
  const title = ref('')
  const loading = ref(false)
  const getUpdateNotice = async () => {
    loading.value = true
    const globalConfigList = await  proxy.$api.getGlobalConfigList({
      key: ['message_title', 'message_content']
    })
    content.value = globalConfigList[1].content
    title.value = globalConfigList[0].content
    loading.value = false
  }

  onMounted(() => {
    getUpdateNotice()
  })
</script>


<style scoped lang="scss">

</style>
